home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / NextAnswers / 1388_swapfile_size_issues.rtf < prev    next >
Text File  |  1993-11-08  |  3KB  |  66 lines

  1. {\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f2\fmodern Courier;\f1\fmodern Ohlfs;}
  2. \paperw10340
  3. \paperh6540
  4. \margl120
  5. \margr120
  6. {\colortbl;\red84\green84\blue84;\red83\green83\blue83;\red82\green82\blue82;}
  7. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\b0\i0\ulnone\fs28\fc0\cf0 Q:  What is the size of the swapfile for NEXTSTEP?\
  8. \
  9. A:   The size of the swapfile depends on the parameters set up in the 
  10. \b /etc/swaptab
  11. \b0  configuration file and the demand for paging on the system.  The swapfile dynamically grows on demand; the demand for swapping depends on the memory needs of the running applications, and the size of the “real” memory (the more real memory the less the demand for paging space).\
  12. \
  13. The 
  14. \b swaptab
  15. \b0  file looks like this:\
  16. \
  17.  
  18. \f2\fs24     #\
  19.     #       /etc/swaptab\
  20.     #\
  21.     /private/vm/swapfile    lowat=20971520  # 20 Meg low water mark\
  22.  
  23. \f0\fs28 \
  24. This tells the system to use the file 
  25. \b /private/vm/swapfile
  26. \b0  for swapping.  It also specifies the parameter 
  27. \b lowat=20971520
  28. \b0 , the “low water mark.”  This low water mark is the smallest size to which the file shrinks.  The paging file then grows as needed to meet demand.\
  29. \
  30. \b hiwat=
  31. \i n
  32. \b0\i0  parameter may be used in the 
  33. \b swaptab
  34. \b0  to set a limit on how large this file grows.\
  35. \
  36. Q: What size is the 
  37. \b swapfile
  38. \b0  when a fresh copy of NEXTSTEP is installed ?\
  39. \
  40. A: It starts out at 16MB out of the box.  It should never get smaller, since this the default size of the lowat mark in /etc/swaptab. \
  41. \
  42. Q: Will the 
  43. \b swapfile
  44. \b0  get smaller (if above the low water mark) while the system is running, or is it reset only upon reboot?\
  45. \
  46. A: The swapfile works in a stack-oriented manner—it shrinks only if the system detects that all pages above a certain address are unallocated.  This rarely occurs.  Consider launching a 4MB application which is completely paged out followed by one more page owned by some other application in the system.  Even if the 4MB is freed the swapfile cannot be truncated until that extra page is freed.  What generally happens is that long-running applications allocate a few pages at the high addresses, and 
  47. \b swapfile
  48. \b0  apparently never shrinks.\
  49. \
  50. During a reboot when paging is turned on (by the invocation of 
  51. \b mach_swapon
  52. \b0 ), the 
  53. \b swapfile
  54. \b0  is immediately truncated to the minimum value.\
  55. \
  56. Note:  Despite the file being called the 
  57. \b swapfile
  58. \b0 , NEXTSTEP uses pure demand-paged memory management.   mach_swapon(8) tells the kernel to initiate paging.\
  59. \
  60. QA569                \
  61. \
  62. Valid for 1.0, 2.0, 3.0, 3.1\
  63. \
  64.  
  65.